<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var reg=/fox/ig;//i表示忽略大小写
			//g:global:全局匹配
			 
			var str="The brown FOX jump the lazy fox";
			alert(reg.test(str));
			str=str.replace(reg,"pig");
			alert(str);
		</script>
	</head>
	<body>
	</body>
</html>
